import request from "@/utils/request";
import type {
  RequestParams,
  ResponseData,
  inventoryRouteRequestParams,
} from "./type";

// 分页列表
export const inventoryRouteList = (data: RequestParams) => {
  return request<ResponseData<inventoryRouteRequestParams>, any>({
    url: "/api/v1/bookOcrName/page",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const addinventoryRoute = (data: inventoryRouteRequestParams) => {
  return request<ResponseData<inventoryRouteRequestParams>>({
    url: "/api/v1/bookOcrName/add",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const delinventoryRoute = (id: number) => {
  return request<ResponseData<inventoryRouteRequestParams>, any>({
    url: "/api/v1/bookOcrName/delete",
    method: "post",
    data: id,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const ForminventoryRoute = (id: number) => {
  return request<ResponseData<inventoryRouteRequestParams>>({
    url: "/api/v1/bookOcrName/form",
    method: "post",
    data: id,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};

export const updateinventoryRoute = (data: inventoryRouteRequestParams) => {
  return request<ResponseData<inventoryRouteRequestParams>>({
    url: "/api/v1/bookOcrName/update",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const LibraryOptions = (aesKeyByRsa: string) => {
  return request<ResponseData<any>>({
    url: "/api/v1/library/options",
    method: "post",
    data: aesKeyByRsa,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
